﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CuserList.aspx.cs" Inherits="ZLDC.Estate.TM.CuserList" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>用户管理</title>
    <link href="../css/main.css" rel="stylesheet" type="text/css" />
    <link href="../js/jquery/style/jquery.hiAlerts.css" rel="stylesheet" type="text/css" />    
    <script src="../js/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>
    <script src="../js/LexunJS.js" type="text/javascript"></script>
    <script src="../js/jShowDiv.js" type="text/javascript"></script>
    <script src="../js/jquery/jquery.hiAlerts-min.js" type="text/javascript"></script>
    
    <link href="../js/jquery.autocomplete/jquery.autocomplete.css" rel="stylesheet" type="text/css" />

    <script type="text/javascript"  >
        function ShowDiv(name, id, status) {
           
           
            var upwd = document.getElementById("pwd").value;
            if (upwd == "0") {
                alert("对不起，你无权修改此密码!");
                return;
            }

            var path = "UserPassWord.aspx?name=" + name + "&status=" + status + "&id=" + id;
            var parameter = "修改密码";
            var style = "dialogWidth:530px; dialogHeight:230px; status:0;scroll:1; help:0; resizable:1;Scrollbars=yes,Toolbar=no,Location=no,Direction=no,Resizeable=no";
            window.showModalDialog(path, parameter, style);
           
        }

       
       
        function UpdateStatus() {
            var hid = document.getElementById("hID").value;
            if (hid == "") {
                alert("请选择要操作的行");
             }
         }

     
         
    </script>

</head>
<body>
    <form id="form1" runat="server"  autocomplete="off">
        <script src="../js/jquery.autocomplete.js" type="text/javascript"></script>

    <table border="0" cellspacing="1" cellpadding="3" style="margin-top: 10px; width: 98%;
        text-align: center;" bgcolor="#a8c7ce">
        <tr>
            <td style="background-color: #FFFFFF; text-align: left;" >
                当前操作部门:<asp:Label ForeColor="Red" Font-Bold="true" ID="ltlDeptName" runat="server"></asp:Label>
            &nbsp;&nbsp;&nbsp;&nbsp;
                <asp:TextBox ID="txtUserName" runat="server"></asp:TextBox>
          &nbsp;<asp:Button ID="btnSearch" CssClass="button_bak" runat="server" Text="查找" 
                    onclick="btnSearch_Click" />
                 
                 <asp:Button ID="btnSave" runat="server"  CssClass="button_bak"  Text="更新" 
                    onclick="btnSave_Click" />
            </td>
        </tr>
       
        <tr>
            <td style="background-color: #FFFFFF; vertical-align: top;">
                <table style="width: 100%">
                    <tr>
                        <td style="background-color: #FFFFFF; vertical-align: top;">
                            <asp:GridView ID="gvArea" runat="server" AutoGenerateColumns="False"
                                AllowPaging="True"  OnRowDataBound="gvArea_RowDataBound"
                                Width="100%" OnPageIndexChanging="gvArea_PageIndexChanging">
                                <Columns>
                                    <asp:TemplateField HeaderText="禁用">
                                        <ItemTemplate>
                                            <asp:CheckBox ID="cbxDisd"  runat="server" />                                      
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    
                                    <asp:TemplateField HeaderText="序号">
                                        <ItemTemplate>
                                            <img alt=""  onclick="ShowDiv('<%# Eval("user_name") %>','<%# Eval("user_id") %>','<%# Eval("status") %>')" style="cursor: pointer;"   title="修改密码" src="../images/mbi_031.gif" />
                                            <asp:Label ID="lblID" runat="server" Text='<%# Eval("user_id") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:BoundField DataField="user_name" HeaderText="用户" />
                                    <asp:BoundField DataField="deptname" HeaderText="部门" />
                                    <asp:BoundField DataField="station" HeaderText="岗位名称" />
                                    <asp:BoundField DataField="status" HeaderText="类型" />
                                    <asp:BoundField DataField="tel" HeaderText="联系电话" />
                                    <asp:BoundField DataField="logindate" HeaderText="最后访问时间" />
                                </Columns>
                                <HeaderStyle BackColor="#F1FADE" />
                            </asp:GridView>
                        </td>
                    </tr>
                  
                </table>
            </td>           
        </tr>
       
       
    </table>
    <input id="uid" type="hidden" />
    <input id="status" type="hidden" />
    <input id="hID" type="hidden" />
    <input id="pwd" type="hidden" value="0"  runat="server"/>
    <script language="javascript" type="text/javascript">
        $(document).ready(function() {
        $("#txtUserName").autocomplete("../Ajax/GetUserAuto.aspx", { minChars: 2, extraParams: { uname: function() { return escape($('#txtUserName').val()); } }, scrollHeight: 350, width: 180, max: 100 });
        });

    </script>

   
    </form>
</body>
</html>
